<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 transitional//EN">
<html>
<head>
<title>Script Data Source Element (Eclipse BIRT ROM Documentation)</title>
<link rel="stylesheet" href="../style/style.css" type="text/css"/>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<p class="title">Eclipse BIRT Report Object Model (ROM)</p>
<p class="subtitle">ScriptDataSource Element</p>
<h1>Element Overview</h1>
<div class="section-text">
A specialized data source defined in JavaScript.</div>
<h3>Details</h3>

<table class="detail-table">
<tr><td>Display Name:</td>
<td>Script Data Source</td></tr>
<tr><td>Since:</td>
<td>1.0</td></tr>
<tr><td>XML Element:</td>
<td><code>script-data-source</code></td></tr>
<tr><td>Extends:</td>
<td><a href="DataSource.html">DataSource</a></td></tr>
<tr><td>Extendable:</td>
<td>Yes</td></tr>
<tr><td>Abstract:</td>
<td>No</td></tr>
<tr><td>Name Space:</td>
<td>Data Sources</td></tr>
<tr><td>Name Requirement:</td>
<td>Required</td></tr>
<tr><td>Allows User Properties:</td>
<td>Yes</td></tr>
<tr><td>Has Style:</td>
<td>No</td></tr>
</table>

<h3>Method Summary</h3>

<dl class="section-text">
<dt><a href="#Method-close">close</a></dt>
<dd>Releases the connection to the external data source.</dd>
<dt><a href="#Method-open">open</a></dt>
<dd>Establishes a connection to the external data source.</dd>
</dl>

<h3>Inherited Properties</h3>

<p class="section-text">
<a href="ReportElement.html#Property-comments">comments</a>, 
<a href="DesignElement.html#Property-customXml">customXml</a>, 
<a href="ReportElement.html#Property-displayName">displayName</a>, 
<a href="ReportElement.html#Property-displayNameID">displayNameID</a>, 
<a href="ReportElement.html#Property-eventHandlerClass">eventHandlerClass</a>, 
<a href="ReportElement.html#Property-extends">extends</a>, 
<a href="ReportElement.html#Property-name">name</a>, 
<a href="ReportElement.html#Property-newHandlerOnEachEvent">newHandlerOnEachEvent</a>, 
<a href="DesignElement.html#Property-propertyMasks">propertyMasks</a>, 
<a href="DesignElement.html#Property-userProperties">userProperties</a>, 
<a href="ReportElement.html#Property-viewAction">viewAction</a>
</p>
<h3>Inherited Methods</h3>

<p class="section-text">
<a href="DataSource.html#Method-beforeOpen">beforeOpen</a>, 
<a href="DataSource.html#Method-beforeClose">beforeClose</a>, 
<a href="DataSource.html#Method-afterOpen">afterOpen</a>, 
<a href="DataSource.html#Method-afterClose">afterClose</a></p>
<h3>Description</h3>

<div class="section-text">
<p>A scripted data source is one that is defined in 
JavaScript. The actual implementation can also be in Java, with a JavaScript 
wrapper. The application is responsible for implementing two operations:</p>

<ul>
<li>Open: connect to the external data source. Report an error if the connection fails.</li>
<li>Close: release the connection to the external data source.</li>
</ul>

<p>A scripted data source may use user-defined properties to 
define connection-specific properties. Doing so allows the developer to put the 
data source into a library, and use it in many reports. For example, the 
developer may define a SOAP data source with properties for the server name, 
port number and so on. The scripts associated with the data source use the ROM 
scripting objects to access the value of these custom properties.</p></div>
<h3>See Also</h3>

<div class="section-text">
<p><code>ScriptDataSet element</code></p>

<p><code>DataSource</code> scripting object</p></div>
<h1>Method Detail</h1>

<h2><a name="Method-close">close Method</a></h2>

<p class="section-text">Releases the connection to the external data source.</p>
<h3>Synopsis
</h3>

<p class="section-text"><code>None&nbsp;obj.close(&nbsp;)</code></p>
<h3>Details
</h3>

<table class="detail-table">
<tr><td>Since:</td>
<td>1.0</td></tr>
<tr><td>Context:</td>
<td>factory</td></tr>
<tr><td>Arguments:</td>
<td>None</td></tr>
<tr><td>Return Type:</td>
<td>None</td></tr>
</table>

<h3>Description</h3>

<div class="section-text">
<p>Called when BIRT wishes to close the data source. Should 
release the connection to the external data source.</p></div>
<h3>See Also</h3>

<div class="section-text">
<p><code>beforeClose</code> method</p>
<p><code>afterClose</code> method</p></div>

<hr>
<h2><a name="Method-open">open Method</a></h2>

<p class="section-text">Establishes a connection to the external data source.</p>
<h3>Synopsis
</h3>

<p class="section-text"><code>None&nbsp;obj.open(&nbsp;)</code></p>
<h3>Details
</h3>

<table class="detail-table">
<tr><td>Since:</td>
<td>1.0</td></tr>
<tr><td>Context:</td>
<td>factory</td></tr>
<tr><td>Arguments:</td>
<td>None</td></tr>
<tr><td>Return Type:</td>
<td>None</td></tr>
</table>

<h3>Description</h3>

<div class="section-text">
<p>Called by BIRT to establish a connection to the data 
source. Throws a JavaScript exception if the connection fails.</p></div>
<h3>See Also</h3>

<div class="section-text">
<p><code>beforeOpen</code> method</p>
<p><code>afterOpen</code> method</p></div>
</body>
</html>
